#!/user/bin/python
# -*- coding: UTF-8 -*-
# 题目：两个乒乓球队进行比赛，各出三人。
# 甲队为a,b,c三人，乙队为x,y,z三人。已抽签决定比赛名单。
# 有人向队员打听比赛的名单。a说他不和x比，c说他不和x,z比，
# 请编程序找出三队赛手的名单。
dict1 = {}
list1 = ('a', 'b', 'c')
list2 = ('x', 'y', 'z')
for i in list1:
    for j in list2:
        if (i == 'a' and j == 'x') or (i == 'c' and ((j == 'x') or (j == 'z'))):
            b = 0
        else:
            dict1[i] = j
print(dict1)

for a in ['x', 'y', 'z']:
    for b in ['x', 'y', 'z']:
        for c in ['x', 'y', 'z']:
            if(a != b)and(b != c)and(c != a) and (a != 'x') and (c != 'x') and (c != 'z'):
                print 'a和%s比赛，b和%s比赛，c和%s比赛' %(a,b,c)

for i in range(ord('x'), ord('z') + 1):
    for j in range(ord('x'), ord('z') + 1):
        if i != j:
            for k in range(ord('x'), ord('z') + 1):
                if (i != k) and (j != k):
                    if (i != ord('x')) and (k != ord('x')) and (k != ord('z')):
                        print 'order is a -- %s\t b -- %s\tc--%s' % (chr(i), chr(j), chr(k))
